Skip to content

AST-76: implement shorthand variants with unit payload#310

Merged
mergify[bot] merged 7 commits intomasterfrom
gabor/enumerated
Apr 15, 2019
Merged

AST-76: implement shorthand variants with unit payload#310
mergify[bot] merged 7 commits intomasterfrom
gabor/enumerated

Conversation

@ggreif
Copy link
Contributor

@ggreif ggreif commented Apr 13, 2019

https://dfinity.atlassian.net/browse/AST-76
https://dfinity.atlassian.net/browse/AST-42

These mimic enumerated types in other languages.

We treat them as nullary patterns/expressions in the parser,
so no parenthesising is necessary.

One decision I made is to equip the implicit units with the source location of the variant tags. This might be confusing for debuggers later (?), but possibly helpful for (type)error messages, i.e. point the user to the right place when unit is not the correct type.

Laundry list:

  • decide whether the REPL output {types, expressions} should appear in shorthand form
  • decide whether debug_show should use shorthand.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants